import React, { useState } from 'react';

import SonFun from './SonAndFather';

const FatherFunModal = () => {

    const [date, setSonDate] = useState({})

    const fatherFun = () => {
        console.log('父模块的方法')
    }

    const fatherGetFun = (msg) => {
        setSonDate(msg)
    }

    return (
        <>
            {/* 子模块 */}
            <SonFun fatherFun={fatherFun} fatherGetFun={fatherGetFun}></SonFun>
            <hr />

            <h3>父方法</h3>
            <h4>sonMsg1：{date.sonMsg1}</h4>
            <h4>sonMsg1：{date.sonMsg2}</h4>
        </>
    )
}

export default FatherFunModal